Skip to content

STYLE: upgrade ruff #52974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 2, 2023
Merged

STYLE: upgrade ruff #52974

merged 10 commits into from
May 2, 2023

Conversation

snorfyang
Copy link
Contributor

@snorfyang snorfyang commented Apr 28, 2023

@snorfyang
Copy link
Contributor Author

There are still some errors. On the latest version of ruff, codes like

match = (
            r"(No such file or directory|没有那个文件或目录|" r"File o directory non esistente)"
        )

will raises

ISC001 Implicitly concatenated string literals on one line

Meanwhile, if we just spilt the lines like

match = (
            r"(No such file or directory|没有那个文件或目录|" 
            r"File o directory non esistente)"
        )

It will be revised automatically by the black hook.

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for working on this

Comment on lines 846 to 848
match = r"(No such file or directory|没有那个文件或目录|File o directory non esistente)"
match = (
r"(No such file or directory|没有那个文件或目录|" r"File o directory non esistente)"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can write this one as something like

match = '|'.join([
    "No such file or directory",
    "没有那个文件或目录",
    "File o directory non esistente",
])

(with black's reformatting)

lama speed 45.0 30.0
llama speed 45.0 30.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these aren't aligned anymore

I'd suggest either:

  • anytime you change lama to llama, fixup the alignment
  • or, just keep the codespell update out of this PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

@@ -79,12 +79,12 @@ repos:
'--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size'
]
- repo: https://github.com/pycqa/pylint
rev: v2.16.2
rev: v3.0.0a6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like pylint have pushed a new tag, but no new release. I'd suggest reverting this change for now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping on this

@@ -79,12 +79,12 @@ repos:
'--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size'
]
- repo: https://github.com/pycqa/pylint
rev: v2.16.2
rev: v3.0.0a6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping on this

lama speed 45.0 30.0
llama speed 45.0 30.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

=1.5 Outdated
@@ -0,0 +1,6 @@
Requirement already satisfied: pandas in /home/yusharthsingh/Desktop/pandas (0+untagged.32262.g3790452.dirty)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this file

@snorfyang snorfyang marked this pull request as ready for review May 2, 2023 16:16
@snorfyang snorfyang requested a review from MarcoGorelli May 2, 2023 16:17
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comment, rest might actually be good this time (if CI passes), thanks

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label May 2, 2023
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @snorfyang !

@MarcoGorelli MarcoGorelli changed the title TYP: Fix pre-commit problems STYLE: upgrade ruff May 2, 2023
@MarcoGorelli MarcoGorelli added this to the 2.1 milestone May 2, 2023
@MarcoGorelli MarcoGorelli merged commit 4f14b45 into pandas-dev:main May 2, 2023
@snorfyang snorfyang deleted the add-typealias branch May 3, 2023 02:55
topper-123 pushed a commit to topper-123/pandas that referenced this pull request May 7, 2023
* Bug: fix pre-commit problems

* fix some errors

* pre commit issues passed

* Delete =1.5

* pytlint and alignment issue

* fix errors

* fix aligned and update ruff

* Update pandas/core/series.py

---------

Co-authored-by: yusharth <yusharthsingh@gmail.com>
Co-authored-by: Yusharth Singh <57184245+yusharth@users.noreply.github.com>
Co-authored-by: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com>
Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
* Bug: fix pre-commit problems

* fix some errors

* pre commit issues passed

* Delete =1.5

* pytlint and alignment issue

* fix errors

* fix aligned and update ruff

* Update pandas/core/series.py

---------

Co-authored-by: yusharth <yusharthsingh@gmail.com>
Co-authored-by: Yusharth Singh <57184245+yusharth@users.noreply.github.com>
Co-authored-by: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com>
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
* Bug: fix pre-commit problems

* fix some errors

* pre commit issues passed

* Delete =1.5

* pytlint and alignment issue

* fix errors

* fix aligned and update ruff

* Update pandas/core/series.py

---------

Co-authored-by: yusharth <yusharthsingh@gmail.com>
Co-authored-by: Yusharth Singh <57184245+yusharth@users.noreply.github.com>
Co-authored-by: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

STYLE use TypeAlias and upgrade ruff
5 participants